
class P10921_39643 {

	public static void main(String[] args) {
		String line = readLn();
		
		while (line != null) {
			
			process(line);
			
			line = readLn();
			
		}
		
	}

	public static int getNumber(char c) {
		switch (c) {
		
			case 'A': 
			case 'B':
			case 'C':
				return 2;
			case 'D':
			case 'E':
			case 'F':
				return 3;
			case 'G':
			case 'H':
			case 'I':
				return 4;
			case 'J':
			case 'K':
			case 'L':
				return 5;
			case 'M':
			case 'N':
			case 'O':
				return 6;
			case 'P':
			case 'Q':
			case 'R':
			case 'S':
				return 7;
			case 'T':
			case 'U':
			case 'V':
				return 8;
			case 'W':
			case 'X':
			case 'Y':
			case 'Z':
				return 9;
			
			default : return -1;
			
		}
	}
	
//	ABC	2
//	DEF	3
//	GHI	4
//	JKL	5
//	MNO	6
//	PQRS	7
//	TUV	8
//	WXYZ	9
	
	private static void process(String line) {
		StringBuffer sb = new StringBuffer();
		for (int k = 0; k < line.length(); k++) {

			char c = line.charAt(k);
			
			if (c >= 'A' && c <= 'Z') {
				sb.append(getNumber(c));
			} else {
				sb.append(c);
			}
		}
		
		System.out.println(sb.toString());
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}

}
